package com.woniu.user.app.apiImpl;

import cn.hutool.core.bean.BeanUtil;
import com.woniu.crowd.client.CrowdManageClient;
import com.woniu.crowd.client.param.PartakeCrowdParam;
import com.woniu.result.Result;
import com.woniu.user.client.UserCrowdManageClient;
import com.woniu.user.client.param.UserPartakeCrowdParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
public class UserPartakeCrowdManageApiImpl implements UserCrowdManageClient {

    @Resource
    private CrowdManageClient crowdManageClient;
    /**
     * 用户参与众筹
     *
     * @param partakeCrowdParam
     * @return
     */
    @Override
    public Result userPartakeCrowd(UserPartakeCrowdParam partakeCrowdParam) throws Exception {
        PartakeCrowdParam partakeCrowdParam1 = BeanUtil.copyProperties(partakeCrowdParam, PartakeCrowdParam.class);
        return crowdManageClient.userPartakeCrowd(partakeCrowdParam1);
    }
}
